
package org.movee.spring.data.hugegraph.gremlin;

/**
 * Provider interface to generate different query to gremlin server.
 * The scripts return queries in steps, organized by List.
 */
public interface CrudGremlinTraversalCreator {
    /**
     * Generate the insert query from source (Vertex, Edge or Graph).
     */
    <T> GremlinTraversal save(final T entity, final Class<T> entityClass);

    /**
     * Generate the findById query from source (Vertex, Edge).
     */
    <T> GremlinTraversal findById(final Object id, final Class<T> entityClass);

    /**
     * Generate the findAll query from source (Vertex, Edge or Graph).
     */
    <T> GremlinTraversal findAll(final Class<T> entityClass);

    <T> GremlinTraversal existsById(final Object id, final Class<T> entityClass);

    /**
     * Generate the Count query from Source (Vertex, Edge)
     */
    <T> GremlinTraversal count(final Class<T> entityClass);

    /**
     * Generate the DeleteById query from source (Vertex, Edge or Graph).
     */
    <T> GremlinTraversal deleteById(final Object id, final Class<T> entityClass);

    /**
     * Generate the deleteAll query from source (Vertex, Edge or Graph).
     */
    <T> GremlinTraversal deleteAll(final Class<T> entityClass);

}
